<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
        <title>更多资讯</title>
        <jsp:include page="../lbi/css.jsp"></jsp:include>
        <link rel="stylesheet" href="<c:url value="/static/layui/css/layui.css"/>" /> 
        <link rel="stylesheet" href="<c:url value="/static/css/marketNews.css"/>" />
    </head>

    <body>
        <div class="wrap">
            <!-- 头部开始-->
            <jsp:include page="../lbi/head.jsp"></jsp:include>
            <!-- 头部结束-->
            <div class="nav_bottom common"></div>
            <!--内容开始-->
            <div class="wrap-middle common">
                <div class="breadcrumb">
                    您的位置：
                    <a href="index.html">首页</a>&gt;
                    <a>行情资讯 </a>&gt;
                    <a>行情评析</a>
                </div>
                <div class="more-content clearfix">
                    <div class="left fl" id="trend_list">
                        
                    </div>
                    
                    <!-- <div class="right fr">
                        <div class="common-title clearfix">
                            <h3 class="right-title fl">最新资讯</h3>
                        </div>
                        <ul class="right-list">
                            <li>
                                <a href="#" class="zx fl">人棉布交投量价一般，粘短持价观市        </a>
                                <span class="fr">05-18</span>
                            </li>
                            <li>
                                <a href="#" class="zx fl">废纸周评：国废黄板纸价格阶段性触顶</a>
                                <span class="fr">05-18</span>
                            </li>
                            <li>
                                <a href="#" class="zx fl">废纸周评：国废黄板纸价格阶段性触顶</a>
                                <span class="fr">05-18</span>
                            </li>
                            <li>
                                <a href="#" class="zx fl">废纸周评：国废黄板纸价格阶段性触顶</a>
                                <span class="fr">05-18</span>
                            </li>
                            <li>
                                <a href="#" class="zx fl">废纸周评：国废黄板纸价格阶段性触顶</a>
                                <span class="fr">05-18</span>
                            </li>
                            <li>
                                <a href="#" class="zx fl">废纸周评：国废黄板纸价格阶段性触顶</a>
                                <span class="fr">05-18</span>
                            </li>
                            <li>
                                <a href="#" class="zx fl">废纸周评：国废黄板纸价格阶段性触顶</a>
                                <span class="fr">05-18</span>
                            </li>
                            <li>
                                <a href="#" class="zx fl">废纸周评：国废黄板纸价格阶段性触顶</a>
                                <span class="fr">05-18</span>
                            </li>
                            <li>
                                <a href="#" class="zx fl">废纸周评：国废黄板纸价格阶段性触顶</a>
                                <span class="fr">05-18</span>
                            </li>
                        </ul>
                    </div> -->
                </div>
            </div>
            <!--内容结束-->
            <footer class="common">
                <div class="footer-top">
                    <ul>
                        <li class="plqq">
                            <span class="icon"></span>
                            <h1>品种规格齐全</h1>
                        </li>
                        <li class="zzbz">
                            <span class="icon"></span>
                            <h1>质量可靠保障</h1>
                        </li>
                        <li class="jgyz">
                            <span class="icon"></span>
                            <h1>价格占有优势</h1>
                        </li>
                        <li class="qqbt">
                            <span class="icon"></span>
                            <h1>缺钱可打白条</h1>
                        </li>
                        <li class="mfzc">
                            <span class="icon"></span>
                            <h1>免费找货找车</h1>
                        </li>
                    </ul>
                </div>
                <div class="footer-bottom">
                    <h1 class="common tc">Copyright©right;2018 www.zaishengwang.com Inc. All rights reserved</h1>
                    <h2 class="common tc">苏ICP证161025号 | 苏ICP备15001001号 | 再生网</h2>
                </div>
            </footer>

        </div>
        <script type="text/javascript" src="<c:url value="/static/layui/layui.all.js"/>"></script>
		<script type="text/javascript">
			$(document).ready(function() {
		        //导航高亮
			    $("#nav_main li").eq(1).addClass("selected-color");
				getListData(20);
				var list_h = $(".left").children(".Daily-list").length;
				$(".left").children(".Daily-list").eq(list_h-1).css({"border-bottom":"none"});
			})
	
			function getListData(size) {
				
				getRequest = GetRequest();
				currPage = getRequest.currPage;
				if (currPage == undefined) {
                    currPage = 1
                }
				
				$.ajax({
	                type: "post",
	                url: "<c:url value="/quotationtrend.do"/>",
	                data: {
	                	 type : 1,
	                	 page : currPage,
                         size : size,
                         setTop : '',
	                },
	                cache: true,
	                async:false, 
	                dataType: "json",
	                success: function(data){
	                     var result = "";
	                     var name = "";
	                     if (data.quotationtrend.result.length>0) {
	                    	 result += '<div class="Daily-list">';
                             result += '<table>';
                             result += '<tbody>';
	                         for (var i = 0 ; i<data.quotationtrend.result.length;i++) {
	                        	 
	                        	 if (data.quotationtrend.result[i].title.length>30) {
	                                 name = data.quotationtrend.result[i].title.substring(0, 30)+"...";
	                             }else {
	                                 name = data.quotationtrend.result[i].title;
	                             }
	                        	 
	                        	 result += '<tr>';
	                        	 result += "<th width='60%'><a href=\"<c:url value="/toQuotationtrendDetails.do"/>?id="+data.quotationtrend.result[i].bId+"\" >"+name+"</a></th>";
	                        	 //result += '<td width="20%">废纸/黄板纸 </td>';
                                 result += '<td class="tr" width="20%">'+data.quotationtrend.result[i].createTime.substring(0, 10)+'</td>';
                                 result += '</tr>';
                                 
                                 if (i % 4 == 3 && i != 0 ) {
                                	 
                                     result += '</tbody>';
                                     result += '</table>';
                                     result += '</div>';
                                     
                                     result += '<div class="Daily-list">';
                                     result += '<table>';
                                     result += '<tbody>';
                                 }
	                         }
	                     }
	                     
	                     result += '</tbody>';
                         result += '</table>';
                         result += '</div>';
	                     result += '<div class="page">';
	                     result += '<div class="tc" id="pagination"></div>';
	                     result += '</div>';
                     
	                     $("#trend_list").html(result);
	                     paged(currPage,20,data.quotationtrend.total); 
	                }
	            })
			};
	
			function paged(currPage, size, pageCount) {
				//分页效果
				layui.use([ 'laypage', 'layer' ], function() {
					var laypage = layui.laypage, layer = layui.layer;
	
					//完整功能
					laypage.render({
						elem : 'pagination',
						count : pageCount,//数据总数
						limit : 20,//每页显示数据
						curr : currPage,
						layout : [ 'prev', 'page', 'next', 'count', 'skip' ],
						jump : function(obj, first) {
							currPage = obj.curr;
							if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr  ajax 再次请求
								window.location.href = '?currPage=' + obj.curr;
								getListData(currPage, 10);
							}
						}
					});
				})
			};
	
			function GetRequest() {
				var url = location.search; //获取url中"?"符后的字串
				var theRequest = new Object();
				if (url.indexOf("?") != -1) {
					var str = url.substr(1);
					strs = str.split("&");
					for (var i = 0; i < strs.length; i++) {
						theRequest[strs[i].split("=")[0]] = unescape(strs[i]
								.split("=")[1]);
					}
				}
				return theRequest;
			}
		</script>
</body>

</html>
